package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.model.user.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * ClassName: UserInfoFeignClient
 * Package: com.atguigu.tingshu.user.client
 * Description:用户内部调用的控制层
 */
@FeignClient(name = "service-user",path = "/client/user/userInfo",contextId = "UserInfoFeignClient")
public interface UserInfoFeignClient {
    /**
     * 根据用户id查询用户信息
     * @param userId
     * @return
     */
    @GetMapping("/getUserInfo/{userId}")
    public UserInfo getUserInfo(@PathVariable("userId") Long userId);

    @GetMapping("/isBuyAlbum/{userId}/{albumId}")
    public Boolean isBuyAlbum(@PathVariable(value = "userId") Long userId,@PathVariable(value = "albumId")Long albumId);

    @GetMapping("/getBuyTrackList/{userId}/{albumId}")
    public Map<String,Integer> getBuyTrackList(@PathVariable(value = "userId") Long userId,
                                              @PathVariable(value = "albumId")Long albumId);
}
